package aau.group52.tilbud.buddy.fragments;

import aau.group52.tilbud.buddy.R;

import android.os.Bundle;
import android.app.ListFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.SeekBar;
import android.widget.Toast;
import android.widget.SeekBar.OnSeekBarChangeListener;

public class BaseListFragment extends ListFragment implements OnSeekBarChangeListener{
public static final int MAX_PROGRESS = 5000, DEFFAULT_PROGRESS = 1000;	//SEKK BARR DEF. VALUES IN METRS
private SeekBar seekBar;
View fragmentLayout;
private String acctionCalled="";
     
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		fragmentLayout = inflater.inflate(R.layout.base_list_fragment, null);
		seekBar = (SeekBar) fragmentLayout.findViewById(R.id.seekBar);
		seekBar.setMax(MAX_PROGRESS);
		seekBar.setProgress(DEFFAULT_PROGRESS);
		
		return fragmentLayout;
	}//When fragment created
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		 
	}//When activity created
	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
		seekBar.setOnSeekBarChangeListener(this);
	}
	//----------seek bar events tracking methods---------------------
	@Override
	public void onProgressChanged(SeekBar seekBar, int progress,
			boolean fromUser) {
		Toast.makeText(getActivity(), "Progress =" + Integer.toString(progress), Toast.LENGTH_SHORT).show();
		
	}
	@Override
	public void onStartTrackingTouch(SeekBar seekBar) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void onStopTrackingTouch(SeekBar seekBar) {
		// TODO Auto-generated method stub
		
	}
	//----------end of seek bar events tracking methods------------------
    
}
